package com.sims.action.ScoreRecord;

import java.util.ArrayList;
import java.util.List;

import org.hibernate.mapping.Array;
import org.springframework.beans.factory.annotation.Autowired;

import com.sims.bean.ScoreRecord;
import com.sims.bean.Student;
import com.sims.service.ScoreRecordService;
import com.sims.util.ActionEnhanced;
import com.sims.util.Constant;

public class FindScoreRecordAction extends ActionEnhanced {
	//private String classId;
//	private String year;
//	private String semester;
	private Student student;
	private List<ScoreRecord> list = new ArrayList();
	@Autowired
	private ScoreRecordService scoreRecordService;
	
	public Student getStudent() {
		return student;
	}
	public void setStudent(Student student) {
		this.student = student;
	}
	//	public String getClassId() {
//		return classId;
//	}
//	public void setStudent(String classId) {
//		this.classId = classId;
//	}
//	public String getYear() {
//		return year;
//	}
//	public void setYear(String year) {
//		this.year = year;
//	}
//	public String getSemester() {
//		return semester;
//	}
//	public void setSemester(String semester) {
//		this.semester = semester;
//	}
	public List<ScoreRecord> getList() {
		return list;
	}
	public void setList(List<ScoreRecord> list) {
		this.list = list;
	}
	
	@Override
	public String execute() {
		
		result = scoreRecordService.findScoreRecord(student, list);
		if (result.containsKey(Constant.SUCCESS)) {
			System.out.println("success");
			return SUCCESS;
		}
		return ERROR;
	}
	
}
